import request from '@/utils/request'

// 获取试卷列表
export function exercisePaging(params) {
  return request({
    url: '/api/exercises/getRepo',
    method: 'get',
    params,
  })
}

// 获取题目列表
export function getQuestion(params, repoId) {
  return request({
    url: '/api/exercises/' + repoId,
    method: 'get',
    params,
  })
}

// 获取题目详情
export function getQuestionDetail(id) {
  return request({
    url: `/api/exercises/question/${id}`,
    method: 'get',
  })
}

// 提交答案
export function submitAnswer(data) {
  return request({
    url: `/api/exercises/fillAnswer`,
    method: 'post',
    data,
  })
}

// 获取答题信息
export function getAnswerInfo(repoId, quId) {
  return request({
    url: `/api/exercises/answerInfo/${repoId}/${quId}`,
    method: 'get',
  })
}
